package com.oocl.crmweb.util;

public class FavsStringUtil {

	public static String favsToString(String[] favs) {
		if (favs == null) {
			return "";
		}
		
		StringBuilder builder = new StringBuilder();
		int index = 0;
		for (String fav : favs) {
			builder.append(fav);
			if (index++ < favs.length - 1) {
				builder.append(";");
			}
		}
		return builder.toString();
	}
	
	public static String[] stringToFavs(String favsStr) {
		if (favsStr == null) {
			return new String[] {};
		}
		return favsStr.split(";");
	}

}
